<template>
   <div>
    
   <el-table :data="bln?tableData.filter((item,index)=>index>=(page-1)*limit&&index<(limit*page)):tableData" border style="width: 100%" current-row-key="bannerid">
     <el-table-column label="序号" max-height="50">
       <template #default="prop">
         {{ prop.$index + 1 }}
       </template>
     </el-table-column>
     <el-table-column label="商品图" max-height="50">
       <template #default="{ row }">
         <div>
           <img height="50" :src="row.img" alt="">
         </div>
       </template>
     </el-table-column>
     <el-table-column label="商品名" max-height="50">
       <template #default="{ row }">
         <div style="height: 50px ;overflow: hidden;">
         {{ row.proname }}
         </div>
       </template>
     </el-table-column>


     <el-table-column label="分类" max-height="50">
       <template #default="{ row }">
         <div>
           {{obnus.nus}}
         </div>
       </template>
     </el-table-column>

  
     <el-table-column label="价格" max-height="50">
       <template #default="{ row }">
         <div>
           {{ row.newprice+'/'+row.unit }}
         </div>
       </template>
     </el-table-column>

   
     <el-table-column label="优惠" max-height="50">
       <template #default="{ row }">
         <div>
           {{ row.activity }}
         </div>
       </template>
     </el-table-column>
     <el-table-column label="操作" max-height="50" width="180" >
       <template #default="{ row }">
         <el-button type="danger" size="mini">Delete</el-button>
         <el-button type="primary" size="mini" @click="$emit('leftedit',row)">Edit</el-button>
       </template>
     </el-table-column>
   </el-table>
 
 </div>
</template>

<script>
  export default {
    props:{
      tableData:{
        type:Array,
        default:()=>[]
      },
      limit:{
        type:Number,
        default:0
      },
      page:{
        type:Number,
        default:0
      },
      total:{
        type:Number,
        default:0
      },
      bln:{
        type:Boolean,
        default:false
      },
      obnus:{
        type:Object,
      }
    }
    
  }
</script>

<style lang="scss" scoped>

</style>